package com.zcxy.fast.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zcxy.fast.anotation.Log;
import com.zcxy.fast.bean.PageQuery;
import com.zcxy.fast.bean.Response;
import com.zcxy.fast.entity.SysComponetItem;
import com.zcxy.fast.vo.SysComponetItemVo;
import com.zcxy.fast.service.ISysComponetItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.*;
import com.zcxy.fast.bean.TreeNode;

/**
 * 组件明细配置表Controller
 *
 * @author zcc
 * @email  860474958@qq.com
 * @date   2021-01-21 15:07:23
 */
@RestController
@RequestMapping("/api/sysComponetItem")
@Api(tags = "组件明细配置表管理")
@Slf4j
public class SysComponetItemController {
    @Autowired
    private ISysComponetItemService iSysComponetItemService;

    @Log("获取组件明细配置表数据-列表")
    @PostMapping(value = "/queryList")
    @ApiOperation(value = "获取组件明细配置表数据-列表", notes = "获取组件明细配置表数据-列表")
    public Response<List<SysComponetItemVo>> queryList(@RequestBody SysComponetItem sysComponetItem) {
        return Response.ok(iSysComponetItemService.queryList( sysComponetItem));
    }



    @Log("修改组件明细配置表数据")
    @PostMapping(value = "/update")
    @ApiOperation(value = "修改组件明细配置表数据", notes = "修改组件明细配置表数据")
    public Response updateSysComponetItem(@RequestBody @Validated @NotNull List<SysComponetItem> sysComponetItems) {
        iSysComponetItemService.updateSysComponetItems(sysComponetItems);
        return Response.ok();
    }




}
